﻿/*----------------------------------------------------------------
//  <copyright file="ISignalRService.cs" company="MicroCloud@151504200868">
//      Copyright © 2020-2024 MicroCloud Corporation, All rights reserved.
//  </copyright>
//  <site>https://gitee.com/chenmm123/microclouds</site>
//  <last-editor>cmm</last-editor>
//  <last-date>2023-09-22 18:29</last-date>
//----------------------------------------------------------------*/

namespace MicroCloud.AspNetCore.SignalR
{
    #region "业务契约：SignalR服务"
    /// <summary>
    /// 业务契约：SignalR服务
    /// </summary>
    public interface ISignalRService
    {
        #region "属性"
        #region "获取 通信连接用户缓存"
        /// <summary>
        /// 获取 通信连接用户缓存
        /// </summary>
        IConnectionUserCache UserCache { get; }
        #endregion
        #region "获取 SignalR Hub（集线器）上下文"
        /// <summary>
        /// 获取 SignalR Hub（集线器）上下文
        /// </summary>
        IHubContext<SignalRHub> SignalRHub { get; }
        #endregion

        #endregion

        #region "方法"
        #region "加入组"
        /// <summary>
        /// 加入组
        /// </summary>
        /// <param name="connectionId">连接ID</param>
        /// <param name="groupKeys">组标识集合</param>
        /// <returns></returns>
        Task<OperationResult> AddToGroup(string connectionId, params string[] groupKeys);
        #endregion
        #region "离开组"
        /// <summary>
        /// 离开组
        /// </summary>
        /// <param name="connectionId">连接ID</param>
        /// <param name="groupKeys">组标识集合</param>
        /// <returns></returns>
        Task<OperationResult> RemoveFromGroup(string connectionId, params string[] groupKeys);
        #endregion

        #endregion

    }
    #endregion

}
